namespace RuoVea.CodeGen.Server.Models;

using SqlSugar;

/// <summary>
/// 表信息
/// </summary>
[SugarTable(nameof(Sys_TableInfo), "表信息")]
public class Sys_TableInfo
{
    /// <summary>
    /// 主键
    /// </summary>
    [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
    public int Table_Id { get; set; }

    /// <summary>
    /// 父表ID
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public int? ParentId { get; set; }

    /// <summary>
    /// 表名
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? TableName { get; set; }

    /// <summary>
    /// 表显示名
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? TableTrueName { get; set; }

    /// <summary>
    /// 列中文名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? ColumnCNName { get; set; }

    /// <summary>
    /// 命名空间
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? Namespace { get; set; }

    /// <summary>
    /// 文件夹名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? FolderName { get; set; }

    /// <summary>
    /// 数据表类型
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? DataTableType { get; set; }

    /// <summary>
    /// 编辑器类型
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? EditorType { get; set; }

    /// <summary>
    /// 排序号
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public int? OrderNo { get; set; }

    /// <summary>
    /// 上传字段
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? UploadField { get; set; }

    /// <summary>
    /// 上传最大数量
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public int? UploadMaxCount { get; set; }

    /// <summary>
    /// 富文本
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? RichText { get; set; }

    /// <summary>
    /// 表达式字段
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? ExpressField { get; set; }

    /// <summary>
    /// 数据库服务器
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? DBServer { get; set; }

    /// <summary>
    /// 排序名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? SortName { get; set; }

    /// <summary>
    /// 详情中文名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? DetailCnName { get; set; }

    /// <summary>
    /// 详情名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? DetailName { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public int? Enable { get; set; }

    /// <summary>
    /// 中文名称
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string? CnName { get; set; }

    /// <summary>
    /// 表列信息
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(Sys_TableColumn.Table_Id))] // 一对多关系配置
    public List<Sys_TableColumn>? TableColumns { get; set; }
}